import requests
import unittest



token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9." \
        "eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoie1widXNlcklkXCI6MSxcInR5cGVcI" \
        "joxLFwiYWNjb3VudFwiOlwieGthZG1pblwiLFwidXNlck5hbWVcIjpcIuaQuuW6t-i2hee6p-euoeeQhuWRmFwiLFwidXNlclR5cGVcIjoxLFwiSXBcIjpc" \
        "IjE5Mi4xNjguMS43NVwifSIsImh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vd3MvMjAwOC8wNi9pZGVudGl0eS9jbGFpbXMvZXhwaXJhdGlvbiI6IjcvMjgv" \
        "MjAyMiAxOjUxOjUxIEFNIiwibmJmIjoxNjU4OTA4MzExLCJleHAiOjE2NTg5NDQzMTEsImlzcyI6ImdzdyIsImF1ZCI6ImdzdyJ9" \
        ".bE09D9EqiQ8k09eDfZsRrdSy9FpZuAtxqzVO2vje-W"
headers = {
    "Authorization" : token,
    "Platform":"YXJKPT",
    "Identifier":"QJTYBS",
    "Content-Type": "application/json"

}

add_info_data = {"global": {"os": 2,
                           "sign":"",
                           "token":token,
                           "timestamp":0,
                           "version":"",
                           "imei":"",
                           "dataSource":15,
                           "langueType":1},
                 "query":{"idCardType":"ZJLX_1",
                          "idCard":"110101199601010019",
                          "diseaseType":"FDCRB_1_4_1",
                          "agencyId":35,
                          "fullName": "王大锤",
                          "parent": "王晓晨",
                          "sex":"XB_1",
                          "maritalStatus":"HYZK_1",
                          "birthday":820454400000,
                          "age":26,
                          "ageUnit":"NLDW_1",
                          "residentType":"JMSD_1",
                          "provinceId":"130000000000",
                          "areaId":"130300000000",
                          "cityId":"130303000000",
                          "detailAddress":"大大大大是11",
                          "people":"RQFL_1",
                          "reportType":"BLFL_1",
                          "diagnosticState":"ZDZT_2",
                          "releaseDate":1657555200000,
                          "diagnosisTime":1657877245000,
                          "deathDate":None,
                          "reportName":"携康超级管理员",
                          "reportDate":1658332800000,
                          "contactHasSymptom":1,
                          "xzAgencyId":3}}

url_add_info = "http://192.168.1.75:4010/controlagg/v1.0/Infectious/AddInfectiousReport"

res = requests.post(url=url_add_info,json=add_info_data,headers=headers)
print("原始的数据编码格式：", res.encoding)
# print(res.text)
# res.encoding = "utf-8"
print(res.json())


